﻿using BLL;
using GUI.Infrastructure;
using GUI.Ressources;
using POCOS;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace GUI.Models
{
    public class ArticleModel
    {
      
        public int Id { get; set; }
        [Required(ErrorMessage="The start date is required")]
        
        [Display(Name = "Date")]
        [DisplayFormat(DataFormatString = "{0:D}")]
       

        public DateTime CreationDate { get; set; }

       
        public string FirstName { get; set; }
      
       
        public DateTime UpdateDate { get; set; }

        public string Title { get; set; }

         [Display(Name = "Actif")]
        public bool IsActive { get; set; }

        [UIHint("tinymce_jquery_full"),AllowHtml]
       
        public string ArticleContenent { get; set; }

        public string  Culture { get; set; }
      

        public Byte[] ImageBytes { get; set; }
        
        public Byte[] ImageMedium { get; set; }
      
        public Byte[] ImageLittle { get; set; }
   
       

        public string ImageUrl { get; set; }
        public Auteur Auteur { get; set; }
        public virtual int AuteurId { get; set; }

        public string Name { get; set; }

        public string EncodeId { get; set; }

        [Display(Name = "Themes", ResourceType = typeof(Resource))]
        [Required(ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "Theme is required")]
        public ICollection<Themes> Themes { get; set; }
        public string LabelDateCreation
        {
            get
            {
                if (CreationDate != null) { return CreationDate.ToShortDateString(); } else { return string.Empty; }
            }
        }

        public ArticleModel()
        {
            Themes = new List<Themes>();
           
        }



      
     
    }
}